function strStr(haystack, needle) {
  if(needle === '') return 0
  haystack = haystack.replace(needle,"@")
  console.log(haystack)
  for(let i = 0; i < haystack.length; i++) {
    if (haystack[i] === "@")
      return i
  }
  return -1
}

console.log(strStr('aaaaa',''))
